import {observable, action, makeAutoObservable} from 'mobx';
class UserInfo {
  userInfo = {name: '默认用户名'};
  location = {
    address: '',
    latitude: '',
    longitude: '',
  };
  constructor() {
    makeAutoObservable(this);
  }
  getUserInfo() {
    return this.userInfo;
  }
  setUserInfo(userInfo) {
    this.userInfo = userInfo;
  }
  getLocation() {
    return this.location;
  }
  setLocation(location) {
    console.log('setLocation', location);
    this.location = {...this.location, ...location};
  }
}

export default UserInfo;